#include <stdio.h>
#include <stdlib.h>

struct Student {
    char name[50];
    float score1;
    float score2;
    float score3;
};

int main() {
    int n;
    scanf("%d", &n);

    struct Student* students = (struct Student*)malloc(n * sizeof(struct Student));
    for (int i = 0; i < n; i++) {
        scanf("%s %f %f %f", students[i].name, &students[i].score1, &students[i].score2, &students[i].score3);
    }
    for (int i = 0; i < n; i++) {
        if (students[i].score1 + students[i].score2 + students[i].score3 >= 180) {
            printf("%s -- pass exam\n", students[i].name);
        }
    }

    for (int i = 0; i < n; i++) {
        if (students[i].score1 + students[i].score2 + students[i].score3 < 180) {
            printf("%s -- not pass exam\n", students[i].name);
        }
    }
    for (int i = 0; i < n; i++) {
        if (students[i].score1 == 100 && students[i].score2 == 100 && students[i].score3 == 100) {
            printf("%s -- 3 x 100.0\n", students[i].name);
        }
    }

    free(students);
    return 0;
}
